package cn.iocoder.yudao.module.system.dal.mysql.workrack;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.workrack.WorkRackDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.workrack.vo.*;

/**
 * 上挂记录 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface WorkRackMapper extends BaseMapperX<WorkRackDO> {

    default PageResult<WorkRackDO> selectPage(WorkRackPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WorkRackDO>()
                .eqIfPresent(WorkRackDO::getWorkId, reqVO.getWorkId())
                .eqIfPresent(WorkRackDO::getSubgroup, reqVO.getSubgroup())
                .eqIfPresent(WorkRackDO::getHangNum, reqVO.getHangNum())
                .eqIfPresent(WorkRackDO::getRemainNum, reqVO.getRemainNum())
                .betweenIfPresent(WorkRackDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WorkRackDO::getId));
    }

}